﻿@namespace Cyss.TaskControl.Components
@typeparam TItem
@inherits ComponentBase

<div>
    <CascadingValue Value="this" IsFixed="true">
        @TableColumns?.Invoke(new TItem())
    </CascadingValue>

    @if (FirstRender)
    {
        <table class="gridtable">
            <tr>
                @foreach (var col in GetColumns())
                {
                    <td>@col.GetDisplayName()</td>
                }
            </tr>
            @{
                this.RowCount = 0;
            }
            @foreach (var item in Items)
            {
                this.RowCount = +1;
                <CascadingValue Value="this" IsFixed="true">
                    <RealTableRow Item=@item></RealTableRow>
                </CascadingValue>
            }
        </table>
    }


</div>
